package br.com.center.loja.mb;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.model.SelectItem;

import br.com.center.loja.mb.utils.BrazilState;
import br.com.center.loja.model.Street;

@ManagedBean(name="street")
@ViewScoped
public class StreetMB extends AbstractMB<Street>
{
	private static final long serialVersionUID = 1L;
	
	public StreetMB() 
	{
		super(Street.class);
	}
	
	public SelectItem[] getStateItem()
	{
		BrazilState[] states = BrazilState.values();
		SelectItem[] items = new SelectItem[states.length];
		int position = 0;
		for(BrazilState state : states)
		{
			items[position++] = new SelectItem(state.name(), state.getName());
		}
		return items;
	}
}
